<div class="page-header">
    <div class="icon">
        <span class="ico-layout-7"></span>
    </div>
    <h1>Libro de Ventas IVA <small>Rreporte generado </small></h1>
</div>

<div class="block">


    <div class="data-fluid">

        <div class="row-form">
            <?php echo $this->Form->create('Reportes'); ?>
            <div class="span10">

                <div class="span2">
                    <?php echo $this->Form->text('fecha_ini', array('class' => 'mask_date', 'value' => '')); ?>

                    <span class="bottom">Fecha Inicial</span>
                </div>
                <div class="span2">
                    <?php echo $this->Form->text('fecha_fin', array('class' => 'mask_date', 'value' => '')); ?>
                    <span class="bottom">Fecha Final</span>
                </div>
                <div class="span2">
                    <?php echo $this->Form->submit('Buscar', array('class' => 'btn btn-info')); ?>
                    <?php echo $this->Form->end(); ?>
                </div>
                <div class="span2">
                    <?php echo $this->Html->link('Exportar Excel', array('action' => 'exportageneral', $fecha_ini, $fecha_fin), array('class' => 'btn btn-success')); ?>

                </div>
            </div>

        </div>
    </div>

    <div class="head purple">
        <div class="icon"><span class="ico-layout-9"></span></div>
        <h2>Transacciones</h2>

    </div>                
    <div class="data-fluid">
        <table class="table fpTable lcnp" cellpadding="0" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th width="5%">Fecha</th>
                    <th width="7%">Nit Comprador</th>
                    <th width="10%">Comprador</th>
                    <th width="5%">No. Factura</th>
                    <th width="6%">Cod. Control</th>
                    <th width="10%">No. Autorizacion</th>
                    <th width="10%">Importe Neto</th>
                    <th width="10%">Debito Fiscal</th> 

                </tr>
            </thead>
            <tbody>
                <?php foreach ($transacciones as $t): ?>
                    <tr>
                        <td><?php echo $t['Facturacione']['fecha_transaccion']; ?></td>
                        <td><?php echo $t['Facturacione']['nit_ci_cliente']; ?></td>
                        <td><?php echo $t['Facturacione']['nombre_cliente']; ?></td>
                        <td><?php echo $t['Facturacione']['numero_factura']; ?></td>
                        <td><?php echo $t['Facturacione']['codigo_control']; ?></td>
                        <td><?php echo $t['Facturacione']['numero_autorizacion']; ?></td>
                        <td>
                            <?php
                            echo $montoNeto = $t['Facturacione']['monto_transaccion'];
                            ?>
                        </td>
                        <td>
                            <?php
                            echo $debitoFiscal = $montoNeto * 0.13;
                            ?>
                        </td>

                    </tr>                       
                <?php endforeach; ?>
            </tbody>
        </table>                    
    </div> 
</div>    
